<@t.html>
	<@t.container title="网站设置" icon="envelope-o" >
				<@t.form id="add_form">
					<#if bean??>
        				<input type="hidden" id="id" name="id" value="${bean.id}"/>	
					</#if>
					<@t.text title="网站标题" id="title" value="${bean.title!''}" />    
					<@t.text title="主域名" id="main_url" value="${bean.main_url!''}" />    
                	<@t.text title="静态资源域名" id="static_url" value="${bean.static_url!''}" />
                	<@t.text title="ICP备案号" id="icp" value="${bean.icp!''}" />
                	<@t.text title="SEO关键字" id="keywords" value="${bean.keywords!''}" />
                	<@t.textarea title="SEO描述" id="desc_text" value="${bean.desc_text!''}" />
                	<@t.textarea title="通用脚本文件" id="footer_script" value="${bean.footer_script!''}" />
                	<@t.text title="管理员Email" id="email" value="${bean.email!''}" />
                	<@t.text title="联系电话" id="phone" value="${bean.phone!''}" />
                	<@t.uploader title="二维码" id="barcode" value="${bean.barcode!''}" help="上传200*200以上（尺寸比例为1：1）" />
                	<@t.select title="是否开放浏览" id="open" datas={"1":"开放","0":"关闭"} defaultValue="${bean.open!''}" />
					<@t.submitBtn title="保存"/>
               </@t.form>
	</@t.container>
 <script type="text/javascript">
     $(function(){
    	 //绑定上传
         $('#barcode').uploadify({'allow':'*.jpg;*.png;*.gif'});
		//提交表单
       	  $('#add_form').validator({
        		theme: 'yellow_right_effect',  //设置theme
        		stopOnError: true, //
        		showOk:false,
        	    fields: {
        	        "title": {
        	            rule: "required;",
        	            ok: "",
        	            tip:"请填写网站标题",
        	            msg: {
        	            	required: "网站标题不可以为空!",
        	            }
        	        },
        	        "email": {
        	            rule: "email",
        	            ok: "",
        	            tip:"请填写管理员邮箱",
        	            msg: {
        	            	email: "管理员邮箱不正确！",
        	            }
        	        }
        	    }
        	});
		  $('#add_form').on('valid.form', function(e, form){
		  	   //成功之后刷新gd，关闭自己
			   var data=$(this).serialize();
			    var this_obj=$('#submit_btn');
				//提交表单
				this_obj.addClass('disabled');
				this_obj.html('提交中...');
               $ .axsf('admin/web/add',data,function(d){
			   		if(d){
                         if(d.code==200){
							window.location.reload();
                         }else{
						 	alert(d.message);
						 }
                	}
					 this_obj.removeClass("disabled");
             		 this_obj.html('保存');
			   });
        });
});
    </script>
</@t.html>